home *** CD-ROM | disk | FTP | other *** search
- ' ***********************************************
- ' * CheckFolderSize.vbs *
- ' * By Vittorio Pavesi (www.vittorio.tk) *
- ' * *
- ' * Verify File System Size *
- ' ***********************************************
-
- 'BaseDirectory = "C:\MyFolder"
- Limit = 100 ' MB
-
- CheckFolder BaseDirectory, Limit
-
- Function CheckFolder(Directory, Limit)
- Set sss = CreateObject("WScript.Shell")
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set f = fso.GetFolder(Directory)
- value = round(f.Size/1048576,2)
- If value > limit Then
- wscript.echo "Error: " & f.Name & " - " & Value & " Mb"
- else
- wscript.echo "OK: " & f.Name & " - " & Value & " Mb"
- End If
- End Function
-